#ifndef SP_DRIVER_CPU_H
#define SP_DRIVER_CPU_H

#include <system/regs.h>
#include <klibc/ctype.h>

#define CPU_FEAT_SSE3				0
#define CPU_FEAT_PCLMUL				1
#define CPU_FEAT_DTES64				2
#define CPU_FEAT_MONITOR			3  
#define CPU_FEAT_DS_CPL				4  
#define CPU_FEAT_VMX				5  
#define CPU_FEAT_SMX				6  
#define CPU_FEAT_EST				7  
#define CPU_FEAT_TM2				8  
#define CPU_FEAT_SSSE3				9  
#define CPU_FEAT_CID				10
#define CPU_FEAT_FMA				11
#define CPU_FEAT_CX16				12 
#define CPU_FEAT_ETPRD				13 
#define CPU_FEAT_PDCM				14
#define CPU_FEAT_DCA				15 
#define CPU_FEAT_SSE4_1				16 
#define CPU_FEAT_SSE4_2				17 
#define CPU_FEAT_x2APIC				18
#define CPU_FEAT_MOVBE				19
#define CPU_FEAT_POPCNT				20 
#define CPU_FEAT_XSAVE				21 
#define CPU_FEAT_OSXSAVE			22 
#define CPU_FEAT_AVX				23
#define CPU_FEAT_FPU				24  
#define CPU_FEAT_VME				25  
#define CPU_FEAT_DE					26  
#define CPU_FEAT_PSE				27  
#define CPU_FEAT_TSC				28;  
#define CPU_FEAT_MSR				29  
#define CPU_FEAT_PAE				30  
#define CPU_FEAT_MCE				31  
#define CPU_FEAT_CX8				32  
#define CPU_FEAT_APIC				33  
#define CPU_FEAT_SEP				34 
#define CPU_FEAT_MTRR				34 
#define CPU_FEAT_PGE				35 
#define CPU_FEAT_MCA				36 
#define CPU_FEAT_CMOV				37 
#define CPU_FEAT_PAT				38 
#define CPU_FEAT_PSE36				39 
#define CPU_FEAT_PSN				40 
#define CPU_FEAT_CLF				41 
#define CPU_FEAT_DTES				42 
#define CPU_FEAT_ACPI				43 
#define CPU_FEAT_MMX				44
#define CPU_FEAT_FXSR				45 
#define CPU_FEAT_SSE				46 
#define CPU_FEAT_SSE2				47 
#define CPU_FEAT_SS					48 
#define CPU_FEAT_HTT				49 
#define CPU_FEAT_TM1				50 
#define CPU_FEAT_IA64				51
#define CPU_FEAT_PBE				52




void cpu_vendor_name();
regs_t cpu_cpuid(int);
void cpu_features();
uint8_t cpu_iffeature(uint8_t);
void cpu_init();
uint64_t cpu_rdtsc();
uint32_t cpu_get_freq();
uint32_t MAX_CPUID_CODE;
uint64_t CPU_FEATURES;
char CPU_VENDOR_NAME[12];

#endif
